function wktToFeatures(text) {
    var features = [];
    var wkts = text.split(";");
    var wkt = new OpenLayers.Format.WKT();
    for (var i = 0; i < wkts.length; i++) {
        var gtype = wkts[i].split("(")[0];
        if ((gtype === "POLYGON") || (gtype === "MULTIPOLYGON")) {
            var feature = wkt.read(wkts[i]);
            if (feature) {
                var geometry = feature.geometry.clone();
                geometry.transform(map.displayProjection, map.projection);
                feature.geometry = geometry;
                features.push(feature);
            }
        }
    }
    return features;
}


function createMapExplorer(domID, clearControls) {

    // layers
    var layer_gmap_sat = new OpenLayers.Layer.Google("Google Satellite", {
        sphericalMercator: true, // use gmap
        type: google.maps.MapTypeId.SATELLITE
    });

    // configs
    var config = {
        projection: new OpenLayers.Projection("EPSG:900913"), // google map
        displayProjection: new OpenLayers.Projection("EPSG:4326"), // google map
        //fractionalZoom: true
    };
    if (clearControls) {
        config.controls = [];
    }

    // create map
    var map = new OpenLayers.Map(
            domID, config);

    // set layers
    map.addLayers([layer_gmap_sat]);

    // cache
    cacheWrite = new OpenLayers.Control.CacheWrite({
        autoActivate: true,
        imageFormat: "image/jpeg",
        layers: [layer_gmap_sat]
    });
    map.addControl(cacheWrite);
    cacheRead = new OpenLayers.Control.CacheRead();
    map.addControl(cacheRead);

    // center & zoom
    map.setCenter(new OpenLayers.LonLat(106.75, -6.1333).transform(
            map.displayProjection,
            map.projection), 4);

    return map;
}